package com.fwpsl.graph;

/**
 * @author: 风戏fw
 * @date: 2024/4/2
 * @description: Edge类表示图中的边
 */
public class Edge<T> {

    /**
     * 边的起点
     */
    Vertex<T> source;

    /**
     * 边的终点
     */
    Vertex<T> destination;

    /**
     * 权重
     */
    double weight;

    public Edge(Vertex<T> source, Vertex<T> destination, double weight) {
        this.source = source;
        this.destination = destination;
        this.weight = weight;
    }

    public Vertex<T> getSource() {
        return source;
    }

    public Vertex<T> getDestination() {
        return destination;
    }

    public double getWeight() {
        return weight;
    }
}
